package com.ruoyi.SuveryInterface.Imp.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.SuveryInterface.Imp.domain.SysEducation;
import com.ruoyi.SuveryInterface.Imp.domain.SysEducationDetails;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-07-03
 */
public interface SysEducationDetailsMapper extends BaseMapper<SysEducationDetails> {


    void insertEducation(SysEducation educationEntity);

    void insertDetailsBatch(@Param("educationDetails") List<JSONObject> educationDetails);


    @Select("select id,code,`result`,result_msg as `resultMsg`, out_trade_no as outTradeNo, tran_amt as tranAmt, tran_time as tranTime, sign ,report_id as reportId ,order_id as orderId ,create_time as createTime, update_time as updateTime from sys_education where order_id = #{orderId}")
    List<SysEducation> selectEducationByOrderId(Long orderId);

    @Select("select id,sys_education_id as `sysEducationId`," +
            "name,id_card as `idCard`,sex,birthday,enrollment_date as `enrollmentDate`," +
            "graduation_date as `graduationDate`,school,specialty,`type`,duration," +
            "study_type as `studyType`,`level`,situation,principal," +
            "cer_no as `cerNo`,minor_school as `minorSchool`,minor_specialty as `minorSpecialty`," +
            "minor_issuance_date as `minorIssuanceDate`,minor_start_end_date as `minorStartEndDate`," +
            "makes_up_school as `makesUpSchool`,makes_up_date as `makesUpDate`,makes_up_cer_no as makesUpCerNo from sys_education_details where sys_education_id = #{educationId}")
    List<SysEducationDetails> selectDetailsByEducationId(Long educationId);

    void insertBatchEducationDetails(@Param("newEducationDetailsList") List<SysEducationDetails> newEducationDetailsList);
}
